﻿using Microsoft.EntityFrameworkCore;


namespace ModelRelationship
{
    public class Blog
    {
        public int Id { get; set; }
        public string Title { get; set; }
        public string Content { get; set; }

        public List<Post> Posts { get; set; }
    }

    public class Post
    {
        public int Id { get; set; }
        public string Title { get; set; }
        public Blog Blog { get; set; }
    }

    /// <summary>
    ///  实体模型的关系和影子属性
    /// </summary>
    public class ShadowPropertyInRelationshipDbContext : DbContext
    {
        public DbSet<Blog> Blogs => Set<Blog>();

    }
}
